package admin

import (
	database "hft/Database"
)

type Clue struct {
	database.Base
	UserId       int         `json:"userId"`
	User         User        `json:"user,omitempty" gorm:"foreignKey:UserId;references:ID;constraint:OnDelete:CASCADE"`
	Phone        string      `json:"phone"`
	OriginName   string      `json:"originName"  gorm:"index"`  //端口
	ActivityName string      `json:"activityName"`              //活动名称
	ActivityId   int         `json:"activityId" gorm:"index"`   //活动id
	PageName     string      `json:"pageName" gorm:"index"`     //页面名称 如果是楼盘就填楼盘名称
	LouPanId     int         `json:"louPanId"`                  //楼盘ID
	IP           string      `json:"ip"`                        //ip
	IpRegion     string      `json:"ipRegion"`                  //ip地址
	Region       int         `json:"region"`                    //提交的区域
	BelongName   string      `json:"belongName"`                //所属区域
	ComeLink     string      `json:"comeLink" gorm:"type:text"` //来源网址
	Cont         string      `json:"cont" gorm:"type:text"`     //线索备注
	PhoneRecord  PhoneRecord `json:"phoneRecord,omitempty" gorm:"foreignKey:CallingId;references:Phone;constraint:OnDelete:CASCADE"`
}

func (Clue) TableName() string {
	return database.TableNameFormat("clue")
}
